#pragma once

// physics engine properties
#define PHYSICS_MAX_CONTACTS				100
#define PHYSICS_MAX_ITERATIONS				100

// 
#define CAMERA_ROTATE_SPEED					1.0f

// force generator info
#define GRAVITY_STRENGTH					30
#define EXPLODE_STRENGTH					100000
#define EXPLODE_MAXRADIUS					40.0f
#define EXPLOSIONSPRITE_SCALE				0.3f

// text info
#define EXPLOSIONTEXT_LIFETIME				0.3f
#define EXPLOSIONTEXT_MINSCALE				1.0f
#define EXPLOSIONTEXT_MAXSCALE				1.5f
#define EXPLOSIONTEXT_COLOR					D3DCOLOR_ARGB(255, 255, 50, 0)
#define SCORETEXT_LIFETIME					0.8f
#define SCORETEXT_MINSCALE					1.0f
#define SCORETEXT_MAXSCALE					2.0f
#define SCORETEXT_COLOR						D3DCOLOR_ARGB(255, 50, 50, 255)
#define SCORETEXT_OBJECTDEATHCOLOR			D3DCOLOR_ARGB(255, 0, 117, 32)
#define SCORETEXT_BLACKBIRDDEATHCOLOR		D3DCOLOR_ARGB(255, 0, 0, 0)
#define SCORETEXT_SEAGULLDEATHCOLOR			D3DCOLOR_ARGB(255, 90, 90, 90)
#define SCORETEXT_PARROTDEATHCOLOR			D3DCOLOR_ARGB(255, 237, 28, 36)
#define SCORETEXT_TOUCANDEATHCOLOR			D3DCOLOR_ARGB(255, 212, 0, 212)
#define SCORETEXT_OBJECTDEATHPOS			D3DXVECTOR3(0.0f, -20.0f, 0.0f)

// bird death info
#define BIRDDEATH_MINSCALE					0.05
#define BIRDDEATH_MAXSCALE					0.1
#define BIRDDEATH_MINVEL					15
#define BIRDDEATH_MAXVEL					20
#define BIRDDEATH_MINANGVEL					1
#define BIRDDEATH_MAXANGVEL					4
#define BIRDDEATH_LIFETIME					0.75
#define BIRDDEATH_SCALEFACTOR				0.2
#define BIRDPARTICLE_H						96
#define BIRDPARTICLE_W						32
#define BIRDPARTICLE_NC						1
#define BIRDPARTICLE_NR						1

// wood death info
#define WOODDEATH_MINSCALE					0.5
#define WOODDEATH_MAXSCALE					1.0
#define WOODDEATH_MINVEL					15
#define WOODDEATH_MAXVEL					20
#define WOODDEATH_MINANGVEL					5
#define WOODDEATH_MAXANGVEL					8
#define WOODDEATH_LIFETIME					2.0
#define WOODDEATH_SCALEFACTOR				0.02
#define WOODPARTICLE_H						64
#define WOODPARTICLE_W						64
#define WOODPARTICLE_NC						1
#define WOODPARTICLE_NR						1

// stone death info
#define STONEDEATH_MINSCALE					0.5
#define STONEDEATH_MAXSCALE					1.0
#define STONEDEATH_MINVEL					15
#define STONEDEATH_MAXVEL					20
#define STONEDEATH_MINANGVEL				5
#define STONEDEATH_MAXANGVEL				8
#define STONEDEATH_LIFETIME					2.0
#define STONEDEATH_SCALEFACTOR				0.01
#define STONEPARTICLE_H						64
#define STONEPARTICLE_W						64
#define STONEPARTICLE_NC					1
#define STONEPARTICLE_NR					1

// projectile info
#define	PROJECTILEPREPARED_DISTANCE			20
#define PROJECTILEUNLOADED_SEPARATEDISTANCE	physics::Vector3(-8,   0,   0)
#define PROJECTILE_FORCEFACTOR				3.5
#define PROJECTILE_TORQUEFACTOR				10.0
#define PROJECTILE_WAITTIME					5.0f
#define PROJECTILE_SLEEPTIMEFACTOR			3.0f

// catapult
#define CATAPULT_HEIGHT						25
#define CATAPULT1_Z							-15
#define CATAPULT2_Z							15

// round/level transition
#define ENDGAME_WAITTIME					5.0f
#define ENDGAME_WAITOSHOWENDSCREEN			3.0f

// volumes
#define SOUNDVOLUME_START					0.5f
#define MUSICVOLUME_START					0.5f

// Markers
#define MARKER_RADIUS						0.5f
#define CREATEMARKER_TIME					0.1f

// point scores
#define SCORE_BIRDDEATH						5000
#define SCORE_OBJECTDEATH					500
#define SCORE_PERWEAPON						10000

// Healthmanager defines
#define DAMAGE_SCALE_FACTOR	0.42
#define DAMAGE_MINIMUM		10
#define DAMAGE_MAXIMUM		100
#define DAMAGE_SOUNDMINIMUM 1

// physics engine defines
#define ENGINE_FRICTION		0.8
#define ENGINE_RESTITUTION	0.45

// ammo type defines
#define ROCKETNUT_VELOCITYFACTOR	100
#define COMPONENTNUT_FACTOR			1/2
#define	EXPLOSION_WAITTIME			3.0f

// help screen defines
#define HELPSCREEN_W				640
#define HELPSCREEN_H				480
#define HELP1START					0
#define HELP1END					2
#define HELP2START					3
#define HELP2END					4
#define HELP3START					5
#define HELP3END					6
#define HELP4START					7
#define HELP4END					8

static char* g_HelpScreenFiles[9] = 
{
	"Assets//Textures//Help1A.png",
	"Assets//Textures//Help1B.png",
	"Assets//Textures//Help1C.png",
	"Assets//Textures//Help2A.png",
	"Assets//Textures//Help2B.png",
	"Assets//Textures//Help3A.png",
	"Assets//Textures//Help3B.png",
	"Assets//Textures//Help4A.png",
	"Assets//Textures//Help4B.png"
};

static char* g_BackdropFiles[2] = 
{
	"Assets//Textures//BackdropDay.png",
	"Assets//Textures//BackdropSunset.png"
};

enum
{
	BACKDROP_DAY,
	BACKDROP_SUNSET
};
// menu button positions
#define BUTTON_MENUPLAY_POS				0.5, 0.35
#define BUTTON_MENUHELP_POS				0.5, 0.45
#define BUTTON_MENUCREDITS_POS			0.5, 0.55
#define BUTTON_MENUOPTIONS_POS			0.5, 0.65
#define BUTTON_MENUQUIT_POS				0.5, 0.75
#define BUTTON_MENUBACK_POS				0.2, 0.35
#define BUTTON_OPTIONSSWITCHFORMAT_POS	0.5, 0.35
#define BUTTON_OPTIONSSOUNDUP_POS		0.68, 0.45
#define BUTTON_OPTIONSSOUNDDOWN_POS		0.35, 0.45
#define BUTTON_OPTIONSMUSICUP_POS		0.68, 0.55
#define BUTTON_OPTIONSMUSICDOWN_POS		0.35, 0.55
#define BUTTON_CONTROLS_POS				0.35, 0.65
#define BUTTON_GAMERESET_POS			0.05, 0.25
#define BUTTON_GAMEMENU_POS				0.05, 0.1
#define BUTTON_GAMETOGGLEHEALTH_POS		0.05, 0.40
#define BUTTON_GAMENEXTHELP_POS			0.8, 0.8
#define BUTTON_GAMEPREVHELP_POS			0.2, 0.8
#define BUTTON_NEXTLEVEL_POS			0.6, 0.8
#define BUTTON_RETRYLEVEL_POS			0.5, 0.8
#define BUTTON_BACKTOMENU_POS			0.4, 0.8
#define BUTTON_LEVELSELECT_POS			(0.3 + 0.06 * col), (0.3 + 0.1 * row)

#define BACKBUFFERSIZE					(float)mD3DPP.BackBufferWidth, (float)mD3DPP.BackBufferHeight

// menu graphic positions and centers
#define MENUBG_CENTER					D3DXVECTOR3(320.0f, 240.0f, 0.0f)
#define MENUBG_POSITION					D3DXVECTOR3(320.0f, 240.0f, 0.0f)
#define MENUTITLE_CENTER				D3DXVECTOR3(298.0f,  70.0f, 0.0f)
#define TOURISTTITLE_CENTER				D3DXVECTOR3( 70.0f, 100.5f, 0.0f)
#define TOURISTTITLE_POSX				(float)mD3DPP.BackBufferWidth * 0.22f
#define TOURISTTITLE_POSY				(float)mD3DPP.BackBufferHeight * 0.7f
#define TOURISTTITLE_SCALE				2.0f

// button sizes
#define LARGEBUTTON_W					128
#define LARGEBUTTON_H					64
#define SMALLBUTTON_W					64
#define SMALLBUTTON_H					32
#define LARGEWIDEBUTTON_W				192
#define LARGEWIDEBUTTON_H				64
#define SMALLWIDEBUTTON_W				96
#define SMALLWIDEBUTTON_H				32
#define ROUNDBUTTON_W					64
#define ROUNDBUTTON_H					64
#define LEVELBUTTON_W					64
#define LEVELBUTTON_H					64

// title graphic dimensions
#define MENUBACKGROUND_W				1240
#define MENUBACKGROUND_H				715
#define MENUTITLE_W						596
#define MENUTITLE_H						140
#define TOURISTTITLE_W					140
#define TOURISTTITLE_H					201
#define ENDSCORE_W						480
#define ENDSCORE_H						640
#define	ENDSCORE_POSX					w * 0.5
#define ENDSCORE_POSY					h * 0.5
#define ENDSCORE_SCALE					0.0007

// backdrop info
#define BACKDROP_W						1235
#define BACKDROP_H						717
#define BACKDROP_CENTER					D3DXVECTOR3(0.0f, 0.0f, 0.0f)
#define BACKDROP_POS					D3DXVECTOR3(0.0f, 0.0f, 1.0f)

// tourist win/lose graphic info
#define WINTOURIST_W				116
#define WINTOURIST_H				200
#define LOSETOURIST_W				140
#define LOSETOURIST_H				201
#define WINLOSETOURIST_POSX			w * 0.5
#define WINLOSETOURIST_POSY			h * 0.5
#define WINLOSETOURIST_SCALE		0.0007
#define STAR_W						64
#define STAR_H						64
#define STAR1_POSX					w * 0.4
#define STAR1_POSY					h * 0.3
#define STAR2_POSX					w * 0.5
#define STAR2_POSY					h * 0.25
#define STAR3_POSX					w * 0.6
#define STAR3_POSY					h * 0.3
#define STAR_SCALE					0.001f

// how fast a bird has to move (speedSquared) before the squawk sound plays
#define BIRDSQUAWK_SPEED			10000

// camera globals
#define	CAMERA_ZOOMSPEED			0.1f
#define CAMERA_MOVESPEED			0.1f
#define CAMERA_RADIUSMIN			60.0f
#define CAMERA_RADIUSMAX			300.0f

// Sound volumes
#define VOLUME_BLACKBIRDDEATH		0.8f
#define VOLUME_SEAGULLDEATH			0.8f
#define VOLUME_PARROTDEATH			0.4f
#define VOLUME_TOUCANDEATH			0.8f
#define VOLUME_BIRDSQUAWK			1.0f
#define VOLUME_WOODBREAK			0.3f
#define VOLUME_WOODIMPACT			0.1f
#define VOLUME_STONEBREAK			0.3f
#define VOLUME_STONEIMPACT			0.1f
#define VOLUME_EXPLOSION			2.0f
#define VOLUME_POP					0.5f
#define VOLUME_PROJECTILELOAD		1.0f
#define VOLUME_PROJECTILEPREPARE	1.0f
#define VOLUME_PROJECTILERELEASE	1.0f
#define VOLUME_MENUCLICK1			1.0f
#define VOLUME_MENUCLICK2			0.5f
#define VOLUME_MENUERROR			0.5f
#define VOLUME_ROCKETNUTLAUNCH		0.5f
#define VOLUME_MULTINUTSPLIT		0.5f
#define VOLUME_COCONUTIMPACT		1.0f
#define VOLUME_TITLEMUSIC			0.5f
#define VOLUME_BEACHAMBIENCE		0.3f
#define VOLUME_AMBIENTRANDOM1		0.2f
#define VOLUME_AMBIENTRANDOM2		0.2f
#define VOLUME_AMBIENTRANDOM3		0.2f
#define VOLUME_AMBIENTRANDOM4		0.2f
#define VOLUME_AMBIENTRANDOM5		0.2f
#define VOLUME_AMBIENTRANDOM6		0.2f
#define VOLUME_AMBIENTRANDOM7		0.2f
#define VOLUME_AMBIENTRANDOM8		0.2f
#define VOLUME_AMBIENTRANDOM9		0.2f
#define VOLUME_WIN					0.5f
#define VOLUME_LOSE					0.5f
#define VOLUME_DING					1.0f

#define AMBIENTRANDOM_PROCCHANCE	0.001f
#define AMBIENTRANDOM_MINDELAY		4.0f
#define AMBIENTRANDOM_NUM			8

// level info
#define NUM_LEVELS					20

static char* g_LevelArray[20] = 
{
	"Levels//Level01.dat",
	"Levels//Level02.dat",
	"Levels//Level03.dat",
	"Levels//Level04.dat",
	"Levels//Level05.dat",
	"Levels//Level06.dat",
	"Levels//Level07.dat",
	"Levels//Level08.dat",
	"Levels//Level09.dat",
	"Levels//Level10.dat",
	"Levels//Level11.dat",
	"Levels//Level12.dat",
	"Levels//Level13.dat",
	"Levels//Level14.dat",
	"Levels//Level15.dat",
	"Levels//Level16.dat",
	"Levels//Level17.dat",
	"Levels//Level18.dat",
	"Levels//Level19.dat",
	"Levels//Level20.dat"
};

#define SCORE_SILVER 0
#define SCORE_GOLD 1
#define SCORE_SHOWSILVER 0.8
#define SCORE_SHOWGOLD 1.6

static int g_LevelScoreLimits[20][2] = 
{
	{15000, 20000},	// 01*
	{15000, 20000}, // 02*
	{30000, 40000}, // 03*
	{15000, 25000}, // 04*
	{20000, 30000}, // 05*
	{15000, 33000}, // 06* 
	{10000, 15000}, // 07* 
	{20000, 30000}, // 08*
	{26000, 35000}, // 09*
	{15000, 15250}, // 10*
	{20000, 35000}, // 11*
	{30000, 45000}, // 12*
	{25000, 35000}, // 13*
	{25000, 35000}, // 14*
	{20000, 30000}, // 15*
	{30000, 45000}, // 16*
	{20000, 30000}, // 17*
	{35000, 40000}, // 18*
	{40000, 55000}, // 19*
	{30000, 40000}  // 20*
};
